package com.wbsxch.secondkill.dto;

import com.wbsxch.secondkill.entity.SuccessKilled;
import com.wbsxch.secondkill.enums.SecondKillStateEnum;

public class SecondKillExecution {

    private long secondKillId;

    private int state;

    private String stateInfo;

    private SuccessKilled successKilled;


    public SecondKillExecution(long secondKillId, SecondKillStateEnum stateEnum, SuccessKilled successKilled) {
        this.secondKillId = secondKillId;
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
        this.successKilled = successKilled;
    }

    public SecondKillExecution(long secondKillId, SecondKillStateEnum stateEnum) {
        this.secondKillId = secondKillId;
        this.state = stateEnum.getState();
        this.stateInfo = stateEnum.getStateInfo();
    }

    public long getSecondKillId() {
        return secondKillId;
    }

    public void setSecondKillId(long secondKillId) {
        this.secondKillId = secondKillId;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public SuccessKilled getSuccessKilled() {
        return successKilled;
    }

    public void setSuccessKilled(SuccessKilled successKilled) {
        this.successKilled = successKilled;
    }

    @Override
    public String toString() {
        return "SecondKillExecution{" +
                "secondKillId=" + secondKillId +
                ", state=" + state +
                ", stateInfo='" + stateInfo + '\'' +
                ", successKilled=" + successKilled +
                '}';
    }
}
